package topo.action;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import topo.MainFrame;
import topo.data.NodeLink;
import topo.service.TopoDataManager;
import topo.utils.DialogTools;

public class LinkDeleteAction extends AbstractAction {
    public void actionPerformed(ActionEvent e) {
        NodeLink link = (NodeLink) getValue("ActionDataKeyName");
        try {
            TopoDataManager.getInstance().delLink(link);
        } catch (Exception ex) {
            DialogTools.showErroMsg(MainFrame.mainFrame, "删除链接出错!");
            ex.printStackTrace();
        }
    }

    public LinkDeleteAction() {
        super("删除链接");
    }
}